space_spikes = {}
space_spikes.register_spike = function(color)
	minetest.register_node("space_spikes:spike_"..color, {
		description = color.." Spike",
		drawtype = "plantlike",
		tiles = {"space_spikes_spike.png^[colorize:"..color..":100"},
		inventory_image = "space_spikes_spike.png^[colorize:"..color..":100",
		paramtype = "light",
		walkable = false,
		damage_per_second = 4,
		groups = {crumbly=3, fruit = 1},
	})

	minetest.register_decoration({
		deco_type = "simple",
		place_on = {"basic:blue_stone"},
		sidelen = 80,
		y_min = -31000,
		y_max = 31000,
		decoration = "space_spikes:spike_"..color,
	})

	minetest.register_decoration({
		deco_type = "simple",
		place_on = {"basic:blue_soul_sand"},
		sidelen = 80,
		y_min = -31000,
		y_max = 31000,
		decoration = "space_spikes:spike_"..color,
	})
end

space_spikes.register_spike("red")
space_spikes.register_spike("green")
space_spikes.register_spike("blue")
space_spikes.register_spike("yellow")
space_spikes.register_spike("black")
